import request from 'utils/request'

// 定义请求函数
const fetchHomeBanner = (params = {}) => request.get('/banner/list', { params });

// 获取所有分类
const fetchAllCates = (params = {} ) => request.get('/shop/goods/category/all', {params})

// 获取 商品列表 属于某个分类下的商品
const fetchItems = (params = {}) => request.post('/shop/goods/list', params)

// 获取商品详情
const fetchItemDetail = (id) => request.get('/shop/goods/detail?id='+id)
export {
  fetchHomeBanner,
  fetchAllCates,
  fetchItems,
  fetchItemDetail
}